<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			#div1{
				width:100px;
				height:100px;
				line-height: 100px;
				text-align: center;
				font:bold 60px/100px "微软雅黑";
				background: black;
				color:white;
				margin:50px auto;
			}
		</style>
		<script>
			window.onload = function(){
				var oDiv = document.getElementById("div1");
				var oldNum;
				var timer = setInterval(function(){
//					获得原来的数
					oldNum = parseInt(oDiv.innerHTML);
//					减小
					oldNum--;
//					新值放入div中
					oDiv.innerHTML = oldNum;
					if(oldNum==0){
						clearInterval(timer);
//						跳转到新的网址
						location.href = 'http://baidu.com';
					}
				},1000);
				
			}
		</script>
	</head>
	<body>
		<div id="div1">
			5
		</div>
	</body>
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
</html>
